package cosplay.Services;

import java.sql.Timestamp;

import cosplay.beans.PhotoInfos;

public class PhotoServices {
	public static PhotoInfos PhotoInfoVerify(PhotoInfos photo)
	{
		Timestamp now=new Timestamp(System.currentTimeMillis());
		if (photo.getCompetitionID()<0)
			return null;
		if (photo.getDescription()==null)
			photo.setDescription("");
		if (photo.getLastviewed().after(now))
			photo.setLastviewed(now);
		if (photo.getTitle()==null)
			return null;
		if (photo.getUploaded().after(now))
			photo.setUploaded(now);
		if (photo.getUserID()<=0)
			return null;
		if (photo.getView()<0)
			return null;
		return photo;
	}
}
